<template>
  <div class="widthdrawral">
    <div class="tops">
      <div class="tops-main">
        <div class="tops-text">贷款总额</div>
        <div class="pay" @click="depositClick">提现</div>
      </div>
      <div class="price">¥40,000</div>
      <div class="tops-bottom">
        <div class="bottom-items">
          <p>已提现金额(元)</p>
          <div class="bottom-price">¥40,000</div>
        </div>
        <div class="bottom-items">
          <p>可提现金额(元)</p>
          <div class="bottom-price">¥40,000</div>
        </div>
      </div>
    </div>
    <div class="tab-control">
      <div class="contain">
        <div
          class="items"
          v-for="(item, index) in title"
          :key="index"
          @click="itemsClick(index)"
        >
          <div class="title" :class="currentIndex == index ? 'active' : ''">
            {{ item }}
            <span class="line"></span>
          </div>
        </div>
      </div>
    </div>
    <div class="pay-list detail" v-if="currentIndex == 1">
      <div class="pay-list-item" v-for="index in 5" :key="index">
        <p class="title">
          <span>现金提现</span>
          <span class="price">-<span> ¥9006.00</span></span>
        </p>
        <div class="desc">
          <div class="lefts">
            <div>充值时间:2020/11/23</div>
            <div class="status">提现状态: 等待财务核对</div>
          </div>
        </div>
        <div class="notes desc">
          提现备注: 这是一个备注提现备注: 这是一个备注提现备注: 这是一个备注
        </div>
      </div>
    </div>
    <div class="pay-list top-up" v-else>
      <div class="pay-list-item" v-for="index in 5" :key="index">
        <p class="title">
          <span>直接推荐一名合伙人</span>
          <span class="price">+<span> ¥9006.00</span></span>
        </p>
        <div class="desc">
          <div class="lefts">充值时间:2020/11/23</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'widthdrawral',
  data() {
    return {
      title: ['奖励明细', '提现明细'],
      currentIndex: 0,
    }
  },
  methods: {
    itemsClick(index) {
      this.currentIndex = index
    },
    depositClick() {
      this.$router.push('/deposit')
    }
  },
}
</script>

<style lang="scss" scoped>
.widthdrawral {
  font-size: 14px;
}
.tops {
  height: 213px;
  padding: 0 20px 0 30px;
  margin: 12px 12px 20px;
  overflow: hidden;
  color: #fff;
  margin-bottom: 20px;
  background: linear-gradient(134deg, #f6b433 0%, #fb4a16 100%);
  box-shadow: 0px 3px 9px 0px rgba(251, 121, 45, 0.2);
  border-radius: 12px;

  .tops-main {
    display: flex;
    justify-content: space-between;
    height: 32px;
    margin-top: 30px;
    .tops-text {
      font-weight: 400;
      color: #ffebc7;
    }
    .pay {
      width: 68px;
      height: 32px;
      text-align: center;
      line-height: 32px;
      background: #fad28c;
      border-radius: 16px;
      color: #884312;
    }
  }
  .price {
    font-size: 32px;
    font-weight: 600;
    color: #f7f6fb;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
  .tops-bottom {
    display: flex;
    margin-top: 20px;
    .bottom-items:nth-child(1) {
      margin-right: 93px;
    }
    p {
      font-size: 12px;
      color: #ffebc7;
    }
    .bottom-price {
      font-size: 20px;
      font-weight: 400;
      color: #f7f6fb;
    }
  }
}

.pay-list {
  padding: 0 12px;
}
.pay-list-item {
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 72px;
  background: #ffffff;
  border-bottom: 1px solid #f7f6fb;
  .title {
    color: #1f0d44;
    font-size: 16px;
  }
  .desc {
    display: flex;
    justify-content: space-between;
    color: #afabb7;
    font-size: 12px;
    .lefts {
      display: flex;
      .pay-count {
        margin: 0 12px;
      }
    }
  }
}
.top-up {
  .title {
    display: flex;
    justify-content: space-between;
    .price {
      color: #622ccc;
      span {
        font-size: 16px;
      }
    }
  }
}
.detail {
  .pay-list-item {
    height: 98px;
    overflow: hidden;
  }
  .title {
    display: flex;
    justify-content: space-between;

    .price {
      color: #1677ff;
      span {
        font-size: 16px;
      }
    }
  }
  .lefts {
    display: flex;
    .status {
      margin-left: 20px;
    }
  }
  .notes {
    // overflow: hidden;
    // text-overflow: ellipsis;
    // white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; //显示省略号
    display: -webkit-box;
    -webkit-line-clamp: 1; //块元素显示的文本行数
    -webkit-box-orient: vertical;
    font-size: 14px;
  }
}
.tab-control {
  width: 100%;
  height: 44px;
  line-height: 44px;
  font-size: 16px;
  // background: #f7f6fb;
  background-color: #fff;
  border-bottom: 1px solid #f7f6fb;
  .contain {
    display: flex;
    justify-content: space-between;
    color: #665e75;
    margin: 0 75px;
  }
}
.active {
  font-size: 16px;
  font-weight: 800;
  color: #1f0d44;
  .line {
    display: block;
    margin: -8px auto 0;
    width: 20px;
    height: 3px;
    background: linear-gradient(225deg, #622ccc 0%, #b620e0 100%);
    border-radius: 2px;
  }
}
</style>